package com.ruoyi.Student_management.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.uuid.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.Student_management.mapper.TbStudentMoralEducationMapper;
import com.ruoyi.Student_management.domain.TbStudentMoralEducation;
import com.ruoyi.Student_management.service.ITbStudentMoralEducationService;

/**
 * 学生德育Service业务层处理
 *
 * @author ruoyi
 * @date 2023-12-26
 */
@Service
public class TbStudentMoralEducationServiceImpl implements ITbStudentMoralEducationService
{
    @Autowired
    private TbStudentMoralEducationMapper tbStudentMoralEducationMapper;

    /**
     * 查询学生德育
     *
     * @param id 学生德育主键
     * @return 学生德育
     */
    @Override
    public TbStudentMoralEducation selectTbStudentMoralEducationById(String id)
    {
        return tbStudentMoralEducationMapper.selectTbStudentMoralEducationById(id);
    }

    /**
     * 查询学生德育列表
     *
     * @param tbStudentMoralEducation 学生德育
     * @return 学生德育
     */
    @Override
    public List<TbStudentMoralEducation> selectTbStudentMoralEducationList(TbStudentMoralEducation tbStudentMoralEducation)
    {
        return tbStudentMoralEducationMapper.selectTbStudentMoralEducationList(tbStudentMoralEducation);
    }

    /**
     * 新增学生德育
     *
     * @param tbStudentMoralEducation 学生德育
     * @return 结果
     */
    @Override
    public int insertTbStudentMoralEducation(TbStudentMoralEducation tbStudentMoralEducation)
    {
//        tbStudentMoralEducation.setCreateTime(DateUtils.getNowDate());
        tbStudentMoralEducation.setId(UUID.randomUUID().toString().replace("-",""));
        return tbStudentMoralEducationMapper.insertTbStudentMoralEducation(tbStudentMoralEducation);
    }

    /**
     * 修改学生德育
     *
     * @param tbStudentMoralEducation 学生德育
     * @return 结果
     */
    @Override
    public int updateTbStudentMoralEducation(TbStudentMoralEducation tbStudentMoralEducation)
    {
        tbStudentMoralEducation.setUpdateTime(DateUtils.getNowDate());
        return tbStudentMoralEducationMapper.updateTbStudentMoralEducation(tbStudentMoralEducation);
    }

    /**
     * 批量删除学生德育
     *
     * @param ids 需要删除的学生德育主键
     * @return 结果
     */
    @Override
    public int deleteTbStudentMoralEducationByIds(String[] ids)
    {
        return tbStudentMoralEducationMapper.deleteTbStudentMoralEducationByIds(ids);
    }

    /**
     * 删除学生德育信息
     *
     * @param id 学生德育主键
     * @return 结果
     */
    @Override
    public int deleteTbStudentMoralEducationById(String id)
    {
        return tbStudentMoralEducationMapper.deleteTbStudentMoralEducationById(id);
    }
}
